package com.situ.day7;

import org.junit.Test;

public class StaticDemo {
	public static void main(String[] args) {
		System.out.println(Stu.country);
		Stu student1 = new Stu("zhangsan", 20, "CN");
		System.out.println(student1.country);
		Stu.show();//只能调用静态方法
		//对象.的方式静态方法和非静态方法都可以访问
		student1.show();
		student1.print();
		//Student student2 = new Student("lisi", 23, "CN");
	}
	
	
	@Test
	public void test1() {
		Teacher teacher1 = new Teacher();
		Teacher teacher2 = new Teacher();
	}
	
	@Test
	public void test2() {
		//int max = Math.max(3, 5);
		//System.out.println(max);
		int[] array = {34, 56, 78, 8};
		int max = ArrayUtil.max(array);
		System.out.println(max);
	}
	
	
	@Test
public void test11() {
	int[] array = {40, 17, 21, 1};
	//外层循环控制比较多少轮（array.length-1）
	for (int i = 1; i <= array.length - 1; i++) {
		for (int j = 0; j < array.length - i; j++) {
			if (array[j] > array[j + 1]) {
				int temp = array[j];
				array[j] = array[j + 1];
				array[j + 1] = temp;
			}
		}
	}
	for (int i = 0; i < array.length; i++) {
		System.out.println(array[i]);
	}
}
	
	
	
}
